Release 10.1A: OpenEdge Development:
Progress Dynamics Advanced Development
Using the API calls translatePhrase and getTranslation
Use the
translatePhrasefunction call to access a text translation. This function returns translations for base text strings one at a time, as shown:
The
translatePhrasefunction takes these parameters:
INPUT pcText (CHARACTER)— The base text string (in the original language) that you want to have translated.INPUT pdLanguageObj (DECIMAL)— The object ID key of the Language table record for the language to be translated into. You can retrieve this object ID, if you need it, using thecurrentLanguageObjproperty, which the Session Manager maintains and can return to you with thegetPropertyListAPI call.RETURNS (CHARACTER)— The function returns the translated string.The
translatePhrasefunction is basically a simplified version of thegetTranslationcall, which you can use when you need more than text strings translated, as shown:
The
getTranslationprocedure takes these parameters:
INPUT pdLanguageObj (DECIMAL)— The object ID of theLanguagetable record identifying the target language. The default is 0 for the current login language.INPUT pcObjectName (CHARACTER)— The name of the application object being translated. This can be an actual object name or it can be blank, in which case the translation that applies to all objects of the widget type (in effect the default value) is returned. This field should also be blank if you’re retrieving a text translation.INPUT pcWidgetType (CHARACTER)— This can be one of the following strings:title,browse,fill-in,radio-set,text,button,toggle-box,combo-box,slider, oreditor. Setting the widget type and widget name both totitleis a special case for window title translation.INPUT pcWidgetName (CHARACTER)— A window title, a text value, or a widget label.INPUT pdWidgetEntry (INTEGER)— The widget entry number is used for radio set items.OUTPUT pcOriginalLabel (CHARACTER)— The widget label in the original language is returned in thisOUTPUTparameter.OUTPUT pcTranslatedLabel (CHARACTER)— The translated widget label is returned in thisOUTPUTparameter. Text translations are also returned in this parameter.OUTPUT pcOriginalTooltip (CHARACTER)— If this is a widget that supports ToolTips, the ToolTip in the original language is returned in thisOUTPUTparameter.OUTPUT pcTranslatedTooltip (CHARACTER)— The ToolTip translation, if any, is returned in thisOUTPUTparameter.
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |